<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>JEU DE MOTS</title>
	<script type="text/javascript">
	function loadXMLDoc(value)
	{
		var xmlhttp;
			if(window.XMLHttpRequest)
			{
				xmlhttp=new XMLHttpRequest();
			}
			else
			{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlhttp.onreadystatechange=function()
			{
				if(xmlhttp.readyState==4 && xmlhttp.status==200)
				{
					document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
				}
			}
			xmlhttp.open("GET","http://localhost/mots/public/play?branch_story_no="+value,true);
			xmlhttp.send();
	}
	</script>
</head>
<body>
	<div id="myDiv">
	<p><?php echo $games_name;?></p>
	<p><?php foreach ($story_content as $key => $value) {
		echo $value;
		echo "</br>";} ?></p>
	<?php 
		foreach ($branch_story_choice as $key => $value) {
			echo '<input type="radio" onclick="loadXMLDoc(this.value)" value="'.$branch_story_choice[$key][0].'" name="branch_story_no">'.$branch_story_choice[$key][1];
			echo '<br/>';
			}
	?>
	</div>
	
</body>
</html>